import { SET_AGE,SET_NUMBER } from "./../actions-type";

let initState = {
  age: 18,
  number: 2000
};

function reducer(state = initState, action) {
  switch (action.type) {
    case SET_AGE:
      return { ...state,age: action.payload };
      case SET_NUMBER:
        return { ...state,number: state.number+action.payload };
    default:
      return state;
  }
}
export default reducer;
